#include<iostream>
#include<unistd.h>
#include<signal.h>
#include<sys/types.h>
int count = 0;
void handlersig(int sig)
{
    std::cout << "获得了一个信号: " << sig << std::endl;
    std::cout << count << std::endl;
    exit(13);
}
int main()
{
    for(int i = 1; i <= 32;i++)
    {
        signal(i,handlersig);
    }
    alarm(1);
    while(true)
    {
        //std::cout << "cout: " << count++ << std::endl;
        count++;
    }
    return 0;
}